package com.studynotes.dev.tech.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author Liu XiaoJun
 * @description: 数据源链接配置对象
 * @date 2025-11-07 10:31:42
 */
@Data
@ToString
@Accessors(chain = true)
@TableName("data_source_link_config")
@Schema(name = "数据源链接配置对象", description = "数据源链接配置")
public class DataSourceLinkConfig implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * Spring注入DS的ID
     * 指定主键名、主键生产策略
     */
    @Schema(name = "dbLinkKey", description = "Spring注入DS的ID")
    @TableId(value = "db_link_key", type = IdType.INPUT)
    private String dbLinkKey;

    /**
     * 链接名称
     */
    @Schema(name = "dbLinkName", description = "链接名称")
    @TableField(value = "db_link_name")
    private String dbLinkName;

    /**
     * 数据库类型：0、mysql 1、postgresql 2、sqlserver 3、oracle  4、db2
     */
    @Schema(name = "dbType", description = "数据库类型：0、mysql 1、postgresql 2、sqlserver 3、oracle  4、db2")
    @TableField(value = "db_type")
    private String dbType;

    /**
     * 数据库URL
     */
    @Schema(name = "dbUrl", description = "数据库URL")
    @TableField(value = "db_url")
    private String dbUrl;

    /**
     * 数据库用户
     */
    @Schema(name = "dbUser", description = "数据库用户")
    @TableField(value = "db_user")
    private String dbUser;

    /**
     * 数据库密码
     */
    @Schema(name = "dbPass", description = "数据库密码")
    @TableField(value = "db_pass")
    private String dbPass;

    /**
     * 显示序号
     */
    @Schema(name = "displaySeq", description = "显示序号")
    @TableField(value = "display_seq")
    private Integer displaySeq;

    /**
     * 数据库模式
     */
    @Schema(name = "dbSchema", description = "数据库模式")
    @TableField(value = "db_schema")
    private String dbSchema;

    /**
     * 标志位：0、禁用 1、正常 2、删除
     */
    @Schema(name = "flag", description = "标志位：0、禁用 1、正常 2、删除")
    @TableField(value = "flag")
    private String flag;

    /**
     * 创建时间
     */
    @Schema(name = "createdTime", description = "创建时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    private LocalDateTime createdTime;

    /**
     * 更新时间
     */
    @Schema(name = "updatedTime", description = "更新时间")
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedTime;

}
